package com.mla.fastdfs;

//import com.mla.fastdfs.service.TelegramRobotService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
//import org.telegram.telegrambots.ApiContextInitializer;
//import org.telegram.telegrambots.meta.TelegramBotsApi;

import javax.annotation.ManagedBean;

@Slf4j
@SpringBootApplication
@MapperScan("com.mla.fastdfs.mapper")
@EnableAsync
public class FastdfsApplication { //implements CommandLineRunner {

    /**@Autowired
    private TelegramRobotService telegramRobot;

    @Value("${telegram.open}")
    private boolean telOpen;

    static {
        ApiContextInitializer.init();
    }**/

    public static void main(String[] args) {
        SpringApplication.run(FastdfsApplication.class, args);
    }

    /**@Override
    public void run(String... args) {
        try {
            if (telOpen) {
                // 实例化Telegram Bots API
                TelegramBotsApi botsApi = new TelegramBotsApi();
                // 注册我们的机器人
                botsApi.registerBot(telegramRobot);
                log.info("Start Telegram OK");
            }
        } catch (Exception e) {
            log.error("Failed To Start Telegram");
            log.error(e.getMessage(), e);
        }

    }**/
}
